package com.zq.kkdady.redis.mapper;

import com.zq.kkdady.redis.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface UserMapper {
    @Select("select * from user")
    List<User> queryAll();

    @Select("select * from user where id = #{id}")
    User findUserById(int id);

    @Update("UPDATE user SET name = #{user.name}," +
            "pwd = #{user.pwd} " +
            "WHERE id = #{user.id}")
    int updateUser(@Param("user") User user);

    @Delete("delete from user where id = #{id}")
    int deleteUserById(int id);
}
